#include <iostream>

#include <SnakeLib/GameStateLoader.h>
#include <SnakeLib/WebClient.h>
#include <SnakeLib/WebSocketEndPoint.h>

#include <MySolver/MySolver.h>

int main()
{
  const std::string server_url = "ws://tetrisj.jvmhost.net:12270/codenjoy-contest/ws";
  const std::string user_name = "Bravo";  // TODO: insert your name here

  try
  {
    snake::WebSocketEndPoint endpoint(server_url, user_name);
    snake::GameStateLoader game_state_loader;
    MySolver solver;
    snake::WebClient client(endpoint, game_state_loader, solver);
    client.Run();
    return 0;
  }
  catch (const std::exception &e)
  {
    std::cerr << "ERROR: " << e.what() << std::endl;
    return 1;
  }
}